﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleApp.TestFunc.Models;

namespace ConsoleApp.TestFunc
{
    [Table("posts")]
    public class Post
    {
        [Key]
        [Column("PostId")]
        public int PostId { get; set; }

        [Column("Title")]
        public string? Title { get; set; }

        [Column("Content")]
        public string? Content { get; set; }

        [Column("BlogId")]
        public int BlogId { get; set; }

        // 外键导航属性
        [ForeignKey("BlogId")]
        public Blog Blog { get; set; } = new Blog();
    }
}
